<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>智慧写作平台</title>
<link href="/pad/resources/css/bootstrap.min.css" rel="stylesheet">
<link href="/pad/resources/css/bootstrap-select.min.css" rel="stylesheet">
<link href="/pad/resources/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="/pad/resources/css/bootstrap-table.min.css" rel="stylesheet">
<link href="/pad/resources/css/bootstrap-editable.css" rel="stylesheet">
<link href="/pad/resources/css/style.css" rel="stylesheet">
<style>
	#buttonLine{
		border-bottom:thin dotted gray;
		margin-left: -20px;
		margin-right: -20px;
		padding-left: 40px;
		vertical-align: middle;
		padding-bottom: 20px;
		margin-bottom: 20px;
	}
	.btn-clicked{
		background-color:#2aabd2;
		border-color:#28a4c9
	}
	#btn-add{
		border:0px solid gray;
		border-radius: 25px;
		width: 25px;
		height:25px;
		background-color: #5ac1df;
		color:#fff;
		text-align: center;
		vertical-align: middle;
		float:right;
		
	}
	#btn-add:active{
		border:thin dotted blue;
		background-color: #2aabd2;
	}
	#btn-add:HOVER {
		background-color: #2aabd3;
	}
	#btn-add:FOCUS {
		border:thin dotted blue;
		background-color: #2aabd2;
	}
</style>
</head>
<body>
	<nav class="navbar navbar-blue navbar-fixed-top" role="navigation">
		<div class="container bs-docs-container">
			<div class="navbar-header">
				<button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-6">
					<span class="sr-only">Toggle navigation</span> <span class="icon-bar"></span> <span class="icon-bar"></span> <span class="icon-bar"></span>
				</button>
				<h1>智慧写作平台</h1>
			</div>
			<ul class="nav navbar-nav">
				<li><a href="/pad">课程列表</a></li>
				<li class="active"><a href="#">反馈模板</a></li>
			</ul>
			<ul class="nav navbar-nav navbar-right">
				<li class="dropdown"><a id="user" href="#" class="dropdown-toggle" data-toggle="dropdown">用户 <span class="caret"></span></a>
					<ul class="dropdown-menu" role="menu">
						<li><a href="/pad/logout">退出登录</a></li>
					</ul></li>
			</ul>
		</div>
	</nav>
	<div class="container bs-docs-container">
		<ol id="breadcrumb" class="breadcrumb">
			<li class="active">首页</li>
		</ol>
		<div id="toolbar"></div>
		<table id="data-table"></table>
	</div>
	<!-- 创建反思写作反馈模板 modal -->
	<div id="createRftTemplateModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">创建反馈模板</h4>
				</div>
				<div class="modal-body">
					<form id="createTemplate" role="form" action="/pad/reflection/saveOrUpdaterftFbTemplate" method="post">
						<div class="form-group">
							<input class="form-control" name="templateName" type="text" placeholder="模板名称">
						</div>
						<div class="form-group">
							<input class="form-control" name="description" type="text" placeholder="描述一下反馈模板用途">
						</div>
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button id="submitFbTpt" type="button" class="btn btn-info" onclick="submitForm('#createTemplate','#createRftTemplateModal');">创建</button>
				</div>
			</div>
		</div>
	</div>
  	<!-- 创建反思写作反馈条目 modal -->
	<div id="createTemplateItemModal" class="modal fade" tabindex="-1" role="dialog" aria-labelledby="mySmallModalLabel" aria-hidden="true">
		<div class="modal-dialog">
			<div class="modal-content">
				<div class="modal-header">
					<button type="button" class="close" data-dismiss="modal">
						<span aria-hidden="true">&times;</span><span class="sr-only">Close</span>
					</button>
					<h4 class="modal-title" id="myModalLabel">创建反馈条目</h4>
				</div>
				<div class="modal-body">
					<form id="createFeedbackItem" role="form" action="/pad/reflection/saveOrUpdateRftFbItem">
						<input type="hidden" name="templateId">

						<div class="form-group">
							<select id="selectFbClassName" onchange="showFeeling(this);" name="className" class="form-control selectpicker commentTemplateSelect" placeholder="反馈维度选择">
								<option value="">--选择反馈的维度--</option>
								<option value="感受">感受</option>
								<option value="思考">思考</option>
							</select>
						</div>
						<div class="form-group"><!-- 表示反馈的   正负性 -->
							<input type="text" name="valuence" class="form-control" placeholder="正负性">
						</div>
						<div class="form-group"> 
							<input type="text" name="content" class="form-control" placeholder="反馈内容">
						</div>
						<div class="form-group">
							<input type="text" name="score" class="form-control" placeholder="分数">
						</div>
						
						
						<div class="form-group">
							<input type="hidden" id="feelingContent"  name="feeling" class="form-control" placeholder="列举感受选项并且以,划分">
						</div>
						
					</form>
				</div>
				<div class="modal-footer">
					<button type="button" class="btn btn-default" data-dismiss="modal">关闭</button>
					<button id="submitFbItem" type="button" class="btn btn-info" onclick="submitForm('#createFeedbackItem','#createTemplateItemModal');">创建</button>
				</div>
			</div>
		</div>
	</div>
	
	<script src="/pad/resources/js/jquery.min.js"></script>
		 <div id="cprtFooter">
	        <!-- 版权信息 -->
	 </div>	

<script type="text/javascript">
		$("#cprtFooter").load("copyrightFooter.html");
</script>
	<script src="/pad/resources/js/jquery.form.min.js"></script>
	<script src="/pad/resources/js/bootstrap.min.js"></script>
	<script src="/pad/resources/js/bootstrap-table.min.js"></script>
	<script src="/pad/resources/js/bootstrap-select.min.js"></script>
	<script src="/pad/resources/js/bootstrap-editable.js"></script>
	<script src="/pad/resources/js/bootstrap-table-editable.js"></script>
	<script src="/pad/resources/js/bootstrap-datetimepicker.min.js"></script>
	<script src="/pad/resources/js/rftTemplate.js"></script>
	<script>
	//写一个方法 获取后台静态 资源  类别名称
	$.ajax({
				async:false,
				url : '/pad/reflection/getClassInfo',
				success : function(data) {
					for(var i=0;i<data.length;i++){
						$("#selectFbClassName").append('<option value="'+data[i][2]+'">'+data[i][2]+'</option>')
					}
			    }
			});
	
	function showFeeling(selected){
		var change=document.getElementById("selectFbClassName").value;
		if(change=="感受"){
		$("#feelingContent").attr("type","text");
		$("#feelingContent").val('')
		$("#feelingContent").attr("placeholder","列举感受选项并且以,划分")
		$("#feelingContent").show()
		}else{
			$("#feelingContent").val('0'); //非感受该字段 写 0
			$("#feelingContent").hide()
		}
		
	}
	
	$(function(){
		var btnSubmit = $("#submitFbItem")
		btnSubmit.on("click",function(){
			 $('#createFeedbackItem')[0].reset();
			 document.getElementById("selectFbClassName").options.selectedIndex = 0;//dom选取id，并选中第一个选项
	         $("#selectFbClassName").selectpicker('refresh');//刷新   清空 模态框值
		})  
	});
	
	$(function(){
		var btnSubmit = $("#submitFbTpt")
		btnSubmit.on("click",function(){
			 $('#createTemplate')[0].reset();
		})  
	});
		    
		
	
	</script>
</body>
</html>
